<template>
	<view>
		<view class="" style="display: flex;justify-content: center;align-items: center; height: 100vh;width: 750rpx;">
			<image @click="handleImageClick" style="width: 600rpx; height: 920rpx;" :src="img" mode="aspectFit"
				:show-menu-by-longpress="true"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				img: '',
			}
		},
		onLoad() {
			this.getMdCenterData()
		},
		methods: {
			getMdCenterData() {
				this.$allrequest.mdAdmin
					.getMdCenterData({}, true)
					.then((res) => {
						if (!res.code) {
							this.getImg(res.data.id)
						} else {
							uni.showToast({
								title: '获取信息失败',
								icon: "none",
							});
						}
					})
			},
			getImg(id) {
				this.$allrequest.mdAdmin
					.PromoteCodes({
						md_id: id
					})
					.then(res => {
						this.img = res.data
					})
			},
			handleImageClick() {
				uni.previewImage({
					urls: [this.img],
					longPressActions: {
						itemList: ['发送给朋友', '保存图片', '收藏'],
						success: function(data) {
						},
						fail: function(err) {
						}
					}
				});
			}
		}
	}
</script>

<style>

</style>